<% Head() Select Case Lcase(request.querystring("Action")) Case"edituser" CheckString "21" EditUser Case"saveuser" CheckString "21" SaveUser Case"adminok" AdminOK Case"executesql" CheckString "56" ExecuteSql Case"sqlpassword" CheckString "56" SqlPassword End select Footer() Sub SqlPassword Dim NewP,OldP NewP=MNBoard.Fun.GetStr("new") oldP=MNBoard.Fun.GetStr("old") If NewP="" And oldP="" then Showtable"更改执行SQL语句的密码","
原密码: 新密码:
" Else If newP="" or oldP="" then goback"","":Exit Sub If MNBoard.Execute("Select * From [i_Config] where SqlPassword='"&MD5(oldP)&"'").Eof Then Goback"","修改失败,原密码不正确!":Exit Sub MNBoard.Execute("update [i_Config] Set SqlPassword='"&MD5(newP)&"'") MNBoard.netLog"操作后台_更改执行SQL语句的密码" Suc "","成功更改执行SQL语句的密码!","?Action=ExecuteSql" End If End Sub Sub ExecuteSql Dim Sql,Password,Caption,Content,S Sql=Request.Form("sql") Password=MNBoard.Fun.GetStr("password") Caption="执行SQL语句" Content="
密码: 更改密码
指令:
注意:此操作不可恢复,如果对SQL语法不了解,请慎用!
" ShowTable Caption,Content If Sql<>"" then If Password="" Then Goback"","":Exit Sub If MNBoard.Execute("Select * From [i_Config] where SqlPassword='"&MD5(Password)&"'").Eof Then Goback"","密码错误":Exit Sub On Error Resume Next MNBoard.Execute(Sql) If err.number=0 then Caption="执行成功":Content="
  • Sql语句正确,已经成功的执行了下面这条语句!
  • "&Sql&"
  • " MNBoard.netLog"操作后台_成功执行SQL语句:
    "&Sql&"" Else Caption="错误信息":Content="
  • 不能执行,语句有问题,具体出错如下:
  • "&Err.Description&"
  • " Err.clear End if ShowTable Caption,Content End if End Sub Sub AdminOK Dim ID,S,isOK Dim Menu(5,10),I,J,Strings,Name,Password,Temp ID=Replace(Request.Form("ID")," ","") Name=Replace(Request("name"),"'","") IsOK=true If Instr(AdminString,",22,")=0 Then IsOK=False If lcase(MNBoard.MyName)<>lcase(Name) Then Goback"","你没有编辑其它管理员的权限!":Exit Sub End If Password=Request("password") If ID<>"" or Password<>"" Then If Password<>"" Then If len(Password)<6 then goback"","后台密码不能设得太简单!为了安全,建议用大小写字母加数字而且不要少于8位的密码!":Exit sub Password=MD5(Password) Temp="[Password]='"&Password&"'" If lcase(Name)=Lcase(MNBoard.GetMemor("Admin","AdminName")) Then MNBoard.LetMemor "Admin","AdminName",Name MNBoard.LetMemor "Admin","AdminPassword",Password End If End If If Temp<>"" Then If ID<>"" Then ID=","&ID&"," Temp=Temp&",Strings='"&ID&"'" End If ELse ID=","&ID&"," Temp="Strings='"&ID&"'" End IF MNBoard.execute("update [i_Admin] Set "&Temp&" where Name='"&Name&"' And BoardID=0") S="更改管理员:"&Name&" 的后台权限成功" MNBoard.netLog"操作后台_"&S Suc "",S,"Admin_Action.asp?Action=TopAdmin" Else Menu(0,0)="系统设置" Menu(0,1)="论坛信息设置" Menu(0,2)="论坛统计设置" Menu(0,3)="公告发布管理" Menu(0,4)="帖间广告管理" Menu(0,5)="论坛联盟管理" Menu(0,6)="I P 封锁管理" Menu(0,7)="论坛日志系统" Menu(0,8)="更新论坛缓存" Menu(0,9)="论坛调用系统" Menu(1,0)="论坛版块" Menu(1,1)="论坛版面管理" Menu(1,2)="添加论坛分类" Menu(1,3)="添加论坛版面" Menu(2,0)="用户管理" Menu(2,1)="用户批量管理" Menu(2,2)="设置管理人员" Menu(2,3)="设置论坛版主" Menu(2,4)="设置 VIP用户" Menu(2,5)="恢复删除用户" Menu(2,6)="设置特别等级" Menu(2,7)="用户等级管理" Menu(3,0)="帖子留言" Menu(3,1)="批量删除帖子" Menu(3,2)="批量移动帖子" Menu(3,3)="批量删除留言" Menu(3,4)="群发信件留言" Menu(3,5)="上传文件管理" Menu(3,6)="论坛回收站" Menu(4,0)="论坛DIY" Menu(4,1)="论坛菜单管理" Menu(4,2)="修改注册协议" Menu(4,3)="风格模板管理" Menu(4,4)="论坛银行管理" Menu(4,5)="论坛帮派管理" Menu(5,0)="论坛数据" Menu(5,1)="压缩数据库" Menu(5,2)="备份数据库" Menu(5,3)="恢复数据库" Menu(5,4)="数据表管理" Menu(5,5)="论坛整理修复" Menu(5,6)="执行SQL语句" Menu(5,7)="空间占用情况" Menu(5,8)="服务器检测" If Name="" Then goback"","":exit Sub Set Rs=MNBoard.Execute("Select Strings from [i_Admin] where name='"&Name&"' and boardID=0") If Rs.Eof Then Goback"","数据不存在":Exit Sub Strings=Rs(0) Rs.Close Response.Write"
    " Response.Write"
    管理员 "&Name&" 后台权限设置
    " Response.Write"
    后台密码:
    未能评级
    " Response.Write"
    密码如果不改请不要填。(为了安全,建议设置强度复杂的密码。)
    " for i=0 to ubound(menu,1) Response.Write"
    "&menu(i,0)&"
    " for j=1 to ubound(menu,2) If isempty(menu(i,j)) then exit for Response.Write" "&i&j&"0 then response.write "checked" If not IsOk Then Response.write " disabled='true'" Response.Write" />"&Menu(i,j) If j mod 5 =0 Then Response.write "
    " next Response.Write"
    " next Response.Write"
    全选  
    " End IF End Sub Sub EditUser Dim ID,Temp,Rs,UserName,Sqlwhere ID=Request("ID") UserName=Request("Name") Sqlwhere="ID="&ID If UserName<>"" then Sqlwhere="Name='"&UserName&"'" Response.Write "
    " Set Rs=MNBoard.Execute("select Name,Password,Clue,Answer,Sex,Mail,Birthday,Home,QQ,isQQpic,Pic,PicW,PicH,Sign,Regtime,RegIp,Lasttime,LastIp,EssayNum,GoodNum,Mark,Coin,BankSave,GameCoin,Honor,Faction,LoginNum,isDel,isVip,isShow,isSign,GradeID,GradeFlag,NewSmsNum,BankTime,ID From [i_USER] where "&Sqlwhere) If Rs.eof Then Goback "","该用户不存在!" Exit Sub End If Response.Write"
    返回用户管理 修改用户: "&Rs(0)&"
    " Response.Write"
    快捷操作设置特别等级组
    提升版主
    完全删除
    封锁注册IP
    封锁最后登陆IP
    用户信息所在等级组:"&MNBoard.GetGradeName(Rs(31),Rs(32))&"
    注册会员时间:"&Rs(14)&"
    最后登陆时间:"&Rs(16)&"
    注册会员时IP记录:"&Rs(15)&"
    最后登陆时IP记录:"&Rs(17)&"
    " Response.Write"
    用户注册信息
    " DIVTR"用户名称:","","",25,1 DIVTR"用户密码:",""," 不改请不要填",25,2 DIVTR"密码问题:","","",25,1 DIVTR"密码答案:",""," 不改请不要填",25,2 DIVTR"性别:","",GetRadio("Sex","女",Rs(4),0)&GetRadio("Sex","男",Rs(4),1),25,1 DIVTR"邮箱:","","",25,2 DIVTR"生日:","","",25,1 DIVTR"主页:","","",25,2 DIVTR"QQ号码:","","",25,1 DIVTR"启用QQ形象作为头像:","",GetRadio("isQQpic","否",Rs(9),0)&GetRadio("isQQpic","是",Rs(9),1)&"(QQ号码必须填写)",25,2 DIVTR"头像:","","",25,1 DIVTR"头像尺寸:","","宽: 高:",25,2 DIVTR"签名:","","",60,1 Response.Write"
    用户论坛信息
    " DIVTR"总帖数:","","",25,1 DIVTR"精华帖数:","","",25,2 DIVTR"积分:","","",25,1 DIVTR"金钱:","","",25,2 DIVTR"存款:","","",25,1 DIVTR"游戏币:","","",25,2 DIVTR"登陆次数:","","",25,1 DIVTR"头衔:","","",25,2 DIVTR"帮派:","","",25,1 Response.Write"
    操作用户选项
    " DIVTR"暂时删除:","",GetRadio("isDel","否",Rs(27),0)&GetRadio("isDel","是",Rs(27),1),25,1 DIVTR"VIP会员:","",GetRadio("isVip","否",Rs(28),0)&GetRadio("isVip","是",Rs(28),1),25,2 DIVTR"屏蔽帖子:","",GetRadio("isShow","否",Rs(29),0)&GetRadio("isShow","是",Rs(29),1),25,1 DIVTR"屏蔽签名:","",GetRadio("isSign","否",Rs(30),0)&GetRadio("isSign","是",Rs(30),1),25,2 Response.Write"
    " Rs.Close End Sub Sub SaveUser Dim OldName,ID,AllTable,i,Temp Dim Name,Password,Clue,Answer,Sex,Mail,Birthday,Home,QQ,isQQpic,Pic,PicW,PicH,Sign,EssayNum,GoodNum,Mark,Coin,BankSave,GameCoin,Honor,Faction,LoginNum,isDel,isVip,isShow,isSign,GradeFlag,GradeID ID=Request.Form("ID") Name=Replace(MNBoard.Fun.Getform("Name"),"'","") If Name="" Then GoBack"","":Exit Sub Password=MNBoard.Fun.GetForm("Password") Clue=MNBoard.Fun.GetForm("Clue") Answer=MNBoard.Fun.GetForm("Answer") Sex=MNBoard.Fun.GetForm("Sex") Mail=MNBoard.Fun.GetForm("Mail") Birthday=MNBoard.Fun.GetForm("Birthday") Home=MNBoard.Fun.GetForm("Home") QQ=MNBoard.Fun.GetForm("QQ") isQQpic=MNBoard.Fun.GetForm("isQQpic") Pic=MNBoard.Fun.GetForm("Pic") PicW=Request.Form("PicW") PicH=Request.Form("PicH") Sign=MNBoard.Fun.GetForm("Sign") EssayNum=Request.Form("EssayNum") GoodNum=Request.Form("GoodNum") Mark=Request.Form("Mark") Coin=Request.Form("Coin") BankSave=Request.Form("BankSave") GameCoin=Request.Form("GameCoin") Honor=MNBoard.Fun.GetForm("Honor") Faction=MNBoard.Fun.GetForm("Faction") LoginNum=Request.Form("LoginNum") isDel=Request.Form("isDel") isVip=Request.Form("isVip") isShow=Request.Form("isShow") isSign=Request.Form("isSign") if not isnumeric(PicW) or not isnumeric(PicH) or not isnumeric(EssayNum) or not isnumeric(GoodNum) or not isnumeric(Mark) or not isnumeric(Coin) or not isnumeric(BankSave) or not isnumeric(GameCoin) or not isnumeric(LoginNum) or not isnumeric(isDel) or not isnumeric(isVip) or not isnumeric(isShow) or not isnumeric(isSign) then GoBack"","一些项必需用数字填写":Exit Sub End If Set Rs=MNBoard.Execute("select name,GradeID,GradeFlag From[i_User] where ID="&ID&"") If Rs.eof Then GoBack"","这个用户根本不存在!":Exit Sub Else OldName=Rs(0) GradeID=Rs(1) GradeFlag=Rs(2) End If Rs.close If Password<>"" Then If len(password)<6 Then Goback"","密码不能少于6位":Exit sub Password="[Password]='"&Md5(Password)&"'," End If If Answer<>"" Then Answer="Answer='"&Md5(Answer)&"'," If Isdate(Birthday) Then Birthday="Birthday='"&Birthday&"'," Else Birthday="Birthday=null," If lcase(Name)<>Lcase(OldName) Then If Not MNBoard.Execute("select name From[i_User] where Name='"&Name&"' And ID<>"&ID&"").eof Then GoBack"","新用户名称已经被注册了,不能改名!":Exit Sub End If End If Temp="update [i_User] Set "&Password&" Clue='"&Clue&"',"&Answer&"Sex="&Sex&",Mail='"&Mail&"',"&Birthday&" Home='"&Home&"',QQ='"&QQ&"',isQQpic="&isQQpic&",Pic='"&Pic&"',PicW="&PicW&",PicH="&PicH&",Sign='"&Sign&"',EssayNum="&EssayNum&",GoodNum="&GoodNum&",Mark="&Mark&",Coin="&Coin&",BankSave="&BankSave&",GameCoin="&GameCoin&",Honor='"&Honor&"',Faction='"&Faction&"',LoginNum="&LoginNum&",isDel="&isDel&",isVip="&isVip&",isShow="&isShow&",isSign="&isSign&" where ID="&ID MNBoard.Execute(Temp) OldName=Replace(OldName,"'","''") Temp="更改用户“"&OldName&"”的资料!" If lcase(Name)<>Lcase(OldName) Then AllTable=Split(MNBoard.BBStable(0),",") For i=0 To uBound(AllTable) MNBoard.Execute("Update [i_Bbs"&AllTable(i)&"] Set Name='"&Name&"' where Name='"&OldName&"'") Next MNBoard.Execute("Update [i_TopicVoteUser] Set [User]='"&Name&"' where [User]='"&OldName&"'") MNBoard.Execute("Update [i_Topic] Set Name='"&Name&"' where Name='"&OldName&"'") MNBoard.Execute("Update [i_Sms] Set MyName='"&Name&"' where MyName='"&OldName&"'") MNBoard.Execute("Update [i_Sms] Set Name='"&Name&"' where Name='"&OldName&"'") MNBoard.Execute("Update [i_Placard] Set Name='"&Name&"' where Name='"&OldName&"'") MNBoard.Execute("Update [i_User] Set Name='"&Name&"' where Name='"&OldName&"'") MNBoard.Execute("Update [i_Admin] Set Name='"&Name&"' where Name='"&OldName&"'") Temp=Temp&" 用户名改为“"&Name&"”" End If '======>>>更新等级 Set Rs=MNBoard.Execute("select BoardID from [i_Admin] where name='"&Name&"' order by BoardID") IF Not Rs.eof Then IF Rs(0)=0 Then GradeFlag=9 ElseIF Rs(0)=-1 Then GradeFlag=8 Else GradeFlag=7 End if End IF Rs.Close If IsVIP=1 and GradeFlag=0 Then GradeFlag=4 If GradeFlag=1 Then'如果为特殊组 If MNBoard.Execute("Select ID From [i_grade] where ID="&GradeID).Eof Then GradeFlag=0 End IF MNBoard.UpdateGrade ID,EssayNum,GradeFlag '<<----- MNBoard.netLog "操作后台_"&Temp Suc"",Temp,"?Action=EditUser&ID="&ID End Sub %>